﻿#include "savestationdialog.h"
#include "ui_savestationdialog.h"

SaveStationDialog::SaveStationDialog(NetWorkStation *in_station,QString title,QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SaveStationDialog)
{
    ui->setupUi(this);
    setWindowTitle(title);
    station = in_station;
    ui->station->setText(station->station);
    ui->freq->setValue(station->freq);
    ui->modRate->setValue(station->modRate);
    ui->modType->setText(station->modType);
    ui->codeType->setText(station->codeType);
}

SaveStationDialog::~SaveStationDialog()
{
    delete ui;
}

void SaveStationDialog::on_noBtn_clicked()
{
    QDialog::reject();
}

void SaveStationDialog::on_okBtn_clicked()
{
    station->setSation(ui->station->text().toStdString());
    station->freq = ui->freq->value();
    station->modRate = ui->modRate->value();
    station->setModType(ui->modType->text().toStdString());
    station->setCodeType(ui->codeType->text().toStdString());
    QDialog::accept();
}
